home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Programming / Mesa-2.2 / src-glu / tess.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-17  |  2.2 KB  |  101 lines

  1. /* $Id: tess.h,v 1.1 1996/09/27 01:19:39 brianp Exp $ */
  2.  
  3. /*
  4.  * Mesa 3-D graphics library
  5.  * Version:  2.0
  6.  * Copyright (C) 1995-1996  Brian Paul
  7.  *
  8.  * This library is free software; you can redistribute it and/or
  9.  * modify it under the terms of the GNU Library General Public
  10.  * License as published by the Free Software Foundation; either
  11.  * version 2 of the License, or (at your option) any later version.
  12.  *
  13.  * This library is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16.  * Library General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU Library General Public
  19.  * License along with this library; if not, write to the Free
  20.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  */
  22.  
  23.  
  24. /*
  25.  * $Log: tess.h,v $
  26.  * Revision 1.1  1996/09/27 01:19:39  brianp
  27.  * Initial revision
  28.  *
  29.  */
  30.  
  31.  
  32. /*
  33.  * This file is part of the polygon tesselation code contributed by
  34.  * Bogdan Sikorski
  35.  */
  36.  
  37.  
  38. #include "gluP.h"
  39.  
  40. #define EPSILON 1e-06 /* epsilon for double precision compares */
  41.  
  42. typedef enum
  43. {
  44.     OXY,
  45.     OYZ,
  46.     OXZ
  47. } projection_type;
  48.  
  49. typedef struct callbacks_str
  50. {
  51.     void (*begin)( GLenum mode );
  52.     void (*edgeFlag)( GLboolean flag );
  53.     void (*vertex)( GLvoid *v );
  54.     void (*end)( void );
  55.     void (*error)( GLenum err );
  56. } tess_callbacks;
  57.  
  58. typedef struct vertex_str
  59. {
  60.     void                *data;
  61.     GLdouble            location[3];
  62.     GLdouble            x,y;
  63.     GLboolean            edge_flag;
  64.     struct vertex_str    *shadow_vertex;
  65.     struct vertex_str    *next,*previous;
  66. } tess_vertex;
  67.  
  68. typedef struct contour_str
  69. {
  70.     GLenum                type;
  71.     GLuint                vertex_cnt;
  72.     GLdouble            area;
  73.     GLenum                orientation;
  74.     struct vertex_str    *vertices,*last_vertex;
  75.     struct contour_str    *next,*previous;
  76. } tess_contour;
  77.  
  78. typedef struct polygon_str
  79. {
  80.     GLuint                vertex_cnt;
  81.     GLdouble            A,B,C,D;
  82.     GLdouble            area;
  83.     GLenum                orientation;
  84.     struct vertex_str    *vertices,*last_vertex;
  85. } tess_polygon;
  86.  
  87. struct GLUtriangulatorObj
  88. {
  89.     tess_contour        *contours,*last_contour;
  90.     GLuint                contour_cnt;
  91.     tess_callbacks        callbacks;
  92.     tess_polygon        *current_polygon;
  93.     GLenum                error;
  94.     GLdouble            A,B,C,D;
  95.     projection_type        projection;
  96. };
  97.  
  98.  
  99. extern void tess_call_user_error(GLUtriangulatorObj *,GLenum);
  100.  
  101.